<template>
	<view>
		<show-res-form ref="show_res_form" :dataList="list" @resultDataSave="resDataSave" :resultData="resData" v-if="list.length > 0"></show-res-form>
	</view>
</template>

<script>
	import showResForm from '@/components/diy-form/show-res-form.vue';
	export default {
		components:{
			showResForm
		},
		data() {
			return {
				join_id:0,
				list:[],
				resData:[],
			}
		},
		onLoad(params) {
			if(params.join_id)
			{
				this.join_id = params.join_id;
				this.getJoinInfo();
			}
		},
		methods: {
			resDataSave(saveData){
				this.resData = saveData;
			},
			getJoinInfo(){
				var that = this;
				that.$http.post('statistics/getUserJoinInfo',{
					join_id:that.join_id
				}).then(res=>{
					if(res.code == 1)
					{
						if(res.data.formlist)
						{
							that.list = JSON.parse(res.data.formlist)
						}
						if(res.data.endData)
						{
							that.resData = JSON.parse(res.data.endData);
						}
					}else{
						that.$api.msg(res.msg);
					}
				})
			}
		}
	}
</script>

<style>

</style>
